package com.Maykk.Demo01;

/**
 * @ClassName: Student
 * @Description: TODO 学生类
 * @Author: MaykkStar@163.com
 */
public class Student {
    public String name;
    private int age;
    protected float score;
    public String number;


    public Student() {
    }

    public Student(String name) {
        this.name = name;
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    protected Student(String name, int age, float score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    private Student(String name, int age, float score, String number) {
        this.name = name;
        this.age = age;
        this.score = score;
        this.number = number;
    }

    public String getName() {
        return name;
    }

    private void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age > 100) {
            System.out.println("ERROR!~");
            System.exit(-1);
        }
        this.age = age;
    }

    public float getScore() {
        return score;
    }

    public void setScore(float score) {
        this.score = score;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                ", number='" + number + '\'' +
                '}';
    }

    public void methodPub() {
        System.out.println("我是公有无参成员方法");
    }

    private void methodPri() {
        System.out.println("我是私有无参成员方法");
    }

    public void methodPub(String str) {
        System.out.println("我是公有带参成员方法，参数为：" + str);
    }

    private void methodPri(String str) {
        System.out.println("我是私有带参构造方法，参数为： " + str);
    }
    public void stuMethod(){
        System.out.println("学生类");
    }
}
